package com.kasax.skin.support;

import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;

public class SkinThemeUtils {
    // 字体属性
    private static int[] TYPEFACE_ATTRS = {
            R.attr.skinTypeFace
    };


    public static void updateStatusBarColor(Context context) {

    }

    public static Typeface getSkinTypeFace(Context context) {
        // 获取字体id
        int skinTypeFaceId = getResId(context, TYPEFACE_ATTRS)[0];
        return SkinResource.getInstance().getTypeface(skinTypeFaceId);
    }

    public static int[] getResId(Context context, int[] attrs) {
        int[] ints = new int[attrs.length];
        TypedArray typedArray = context.obtainStyledAttributes(attrs);
        for (int i = 0; i < typedArray.length(); i++) {
            ints[i] = typedArray.getResourceId(i, 0);
        }
        typedArray.recycle();
        return ints;
    }
}
